<?php
class Message {
	/**
	 * 发送短信
	 * @time	2013-11-09 12:27
	 * @param	string phone
	 * 
	 */
	static public function sendMsg($mobtel,$code){
		header("content-type:text ml;charset=utf-8");
		//帐号配置文件
		$comid		 =	"1442"; //企业ID
		$username	= 	"liuricheng"; //用户名
		$userpwd	= 	"lrc717120"; //密码
		$smsnumber	= 	"10690"; //所用平台			
		$msg 		= 	"尊敬的用户:您在音伴尔家庭云课堂注册的密码是:" . $code . " ，有效时间10分钟【音伴尔】";			
		$msg 		= 	urlencode(mb_convert_encoding($msg, 'gbk' ,'utf-8')); /* 转码处理 */
		$url 		= 	"http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
		$string 	= 	file_get_contents($url);
		return  $string;
	}
	
	/**
	 * 通用型的
	 * Enter description here ...
	 * @param unknown_type $mobtel
	 * @param unknown_type $code
	 */
	static public function sendCode($mobtel,$code){
		header("content-type:text ml;charset=utf-8");
		//帐号配置文件
		$comid		 =	"1442"; //企业ID
		$username	= 	"liuricheng"; //用户名
		$userpwd	= 	"lrc717120"; //密码
		$smsnumber	= 	"10690"; //所用平台			
		$msg 		= 	"你好，音伴尔发给您的验证码是:" . $code . " ，有效时间10分钟【音伴尔】";			
		$msg 		= 	urlencode(mb_convert_encoding($msg, 'gbk' ,'utf-8')); /* 转码处理 */
		$url 		= 	"http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
		$string 	= 	file_get_contents($url);
		return  $string;
	}
	
	static public function sendPassword($mobtel,$code){
		header("content-type:text ml;charset=utf-8");
		//帐号配置文件
		$comid		 =	"1442"; //企业ID
		$username	= 	"liuricheng"; //用户名
		$userpwd	= 	"lrc717120"; //密码
		$smsnumber	= 	"10690"; //所用平台			
		$msg 		= 	"你好，在音伴尔重置后的密码是:" . $code . "【音伴尔】";			
		$msg 		= 	urlencode(mb_convert_encoding($msg, 'gbk' ,'utf-8')); /* 转码处理 */
		$url 		= 	"http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
		$string 	= 	file_get_contents($url);
		return  $string;
	}
	
	static public function sendAppUrl($mobtel,$code){
		header("content-type:text ml;charset=utf-8");
		//帐号配置文件
		$comid		 =	"1442"; //企业ID
		$username	= 	"liuricheng"; //用户名
		$userpwd	= 	"lrc717120"; //密码
		$smsnumber	= 	"10690"; //所用平台			
		$msg 		= 	"你好，音伴尔发给您的手机app下载连接:  " . $code . "  【音伴尔】";			
		$msg 		= 	urlencode(mb_convert_encoding($msg, 'gbk' ,'utf-8')); /* 转码处理 */
		$url 		= 	"http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=$comid&username=$username&userpwd=$userpwd&handtel=$mobtel&sendcontent=$msg&sendtime=&smsnumber=$smsnumber";
		$string 	= 	file_get_contents($url);
		return  $string;
	}
	
	
}